#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=2e5+1000;
const int mod=1e9+7;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
int dp[2];
int numberOfUniqueGoodSubsequences(string s) {
        int ans=1;
        dp[2]={0};
        int n=s.size();
        int findzero=0;
        if(s[0]=='0') ++dp[0],++findzero;
        for(int i = 1; i < n; ++i)
        {
            if(s[i]=='0'&&!findzero) ++findzero,++ans,++dp[0],++dp[1];
            int t=ans;
            ans=( (ans+ans)%mod - dp[s[i]-'0'] +mod )%mod;
            dp[s[i]-'0']=t;
        }
     return ans%mod;
}
int main(void){

    string s;cin>>s;
    cout<<numberOfUniqueGoodSubsequences(s)<<endl;

   	return 0;
}
